<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>乘法口诀</title>
    <style>
      .formula {
        display: inline-block;
        width: 120px;
        background-color: antiquewhite;
        border: 1px solid #000;
        margin: 8px;
        text-align: center;
      }
      .line {
        display: block;
        border-bottom: #000 1px dashed;
      }
    </style>
  </head>
  <body>
    <script>
      let divHTML = "";
      for (let i = 1; i <= 9; i++) {
        // 开始新行，并添加行标题
        for (let b = 1; b <= i; b++) {
          divHTML += `<div class="formula">${b}×${i}=${b * i}</div>`; // 添加乘法结果
        }
        divHTML += "<div class='line'></div>"; // 结束当前行
      }

      document.write(divHTML); // 将生成的HTML插入到表格中
    </script>
  </body>
</html>
